package rjp;

import java.io.IOException;

import rjp.map.CachingSantaMap;
import rjp.map.SantaMap;
import rjp.solution.Solution;
import rjp.solver.NearestNeighbourSolver;


public class NNTest {

	public static void main(String[] args) throws Exception {
		SantaMap map = new CachingSantaMap("santa_cities.csv", 20);

		for(int i=0; i<100; i++)
		{
//			try
//			{
				Solution solution=(new NearestNeighbourSolver(map)).solve(map);
				System.out.println(solution.isLegal());
				System.out.println(solution.getScore());
				solution.writeToFile("NNsolution_"+solution.getCityA(0)+"_"+solution.getCityB(0)+".csv");
//			} catch(Exception e)
//			{
//				System.out.println(e);
//			}
		}
	}
}
